//
//  XMPPSharedInstance.h
//  MooreDoll
//
//  Created by 郭景豪 on 2014/11/27.
//  Copyright (c) 2014年 Tank. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ConnectStateDelegate.h"
#import "GetFriendVcardDelegate.h"

#import <UIKit/UIKit.h>
#import "FiendFriend.h"
#import "AppDelegate.h"

#import "Roster.h"
#import "ChatRoom.h"
#import "ChatMessage.h"

@class XMPPSharedInstance;
@protocol XMPPToyVcardDelegate <NSObject>
-(void)setToyVcard;
@end

@interface XMPPSharedInstance : NSObject<UIAlertViewDelegate>
{
    //XCLIENT {
    dispatch_queue_t xmppQueue;
    void *xmppQueueTag;
    //XCLIENT }

    int isLoingOrLogout;
    
}
@property (nonatomic,weak)id<XMPPToyVcardDelegate>toyVcardDelegate;
@property (nonatomic,weak)id<ConnectStateDelegate>stateDelegate;
@property (nonatomic,weak)id<GetFriendVcardDelegate>getFriendVcardDelegate;


//登入用的AlertView
@property (nonatomic,strong)UIAlertView* AV_Loading;

//取得使用者的AlertView
@property (nonatomic,strong)UIAlertView* AV_GetUserInfoLoading;

//取得Toy的AlertView
@property (nonatomic,strong)UIAlertView* AV_SetToyVcardLoading;


//連線狀態
@property (nonatomic)int state;





+(XMPPSharedInstance *)sharedInstance;

/*
 登入
 */
- (void)loginXMPP;

/*
 登入2 不用驗證帳號密碼且不會有alertview
 */
-(void)login;

/*
 登出
 */
- (void)logoutXMPP;

/*
 修改使用者的Vcard 狀態
 */
- (void)changeVCard:(NSDictionary *)userInfo;

/*
 取得使用者Vcard
 */
- (void)getVCard;

/*
 取得朋友Vcard
 */
-(void)getFriendVCard:(NSString *)JID;

/*
 修改娃娃的Vcard
 */
-(void)changeToyVcard:(NSDictionary *)toyInfo;

/*
 重新取得朋友列表
 */
-(void)getFriendRoster;










void my_event_func(char *a[], int n); // this is call back method

//FUNCTION SET ALARM {
char *getAlarmString(int isremote);
void set_alarm();
//FUNCTION SET ALARM }
@end
